<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
    <title>用户授权</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta name="author" content="飞啊飘啊">
	<meta name="hashcode" content="1260274982">
	
	<script>window.duteTag="lz";</script>
	<script type="text/javascript" src="/admin/js/dute-1.0.js"></script>
	<script type="text/javascript" src="/admin/js/jquery-1.7.1.min.js"></script>
	
	<script type="text/javascript" src="/admin/js/lazy3q.ui.js"></script>
	<script>
		document.write('<link rel="stylesheet" type="text/css" href="/admin//css/'+($.cookie('theme')||'elegant')+'/lazy3q.ui.css" /> ');
	</script>
	
	<script type="text/javascript" src="/admin/js/jquery-ui-1.10.2.custom.min.js"></script>
	
	<!-- 用户自定义js(懒加载) -->
	<script type="text/javascript" src="/admin/js/define.js"></script>
	<!-- 用户自定义css样式 -->
	<link rel="stylesheet" type="text/css" href="/admin/css/define.css"/>
	<!-- icon font -->
  	<link rel="stylesheet" href="/admin/css/iconfont.css">
	
	
	
	<script type="text/javascript">
		window.basePath="/";
		window.hashcode = "1260274982";
	</script>
		
	<!-- 感谢kindeditor出品的在线HTML编辑控件 -->
	<script type="text/javascript" charset="utf-8" src="/admin/js/kindeditor/kindeditor.js"></script>
		
	<!-- 感谢My97DatePicker出品的时间控件 -->
	<script language="javascript" type="text/javascript" src="/admin/js/My97DatePicker/WdatePicker.js"></script>
	
	<!------------------------VIEW_HTML_HEAD------------------------>
	<!------------------------VIEW_HTML_HEAD------------------------>	
	
</head>
<script>
Page({
  data:{
    
  },
  onLoad: function(options) {
  	var THIS = this;
  	THIS.setData(options);
  	$.getAjax("oauth.get.do",options,function(protocol){
  		if(protocol.message){
  			$.toast(protocol.message);
  		}
  		document.title={
  			 "insert":"创建用户授权"
  			,"inport":"导入用户授权"
  			,"update":"修改用户授权"
  			,"detail":"用户授权详情"
  		}[options.edittype];
  		THIS.setData(protocol.data); 
  		/******************VIEW_HTML_SET_DATA******************/
  		/******************VIEW_HTML_SET_DATA******************/
  	});
  }
});
</script>
<script>
window["lzFlashUrl"]=top.lzFlashUrl||"/admin/flash/";
window["uploadUrl"]=top.uploadUrl||"/admin/upload.do";

$(function(){
		 
	$("#oauthForm").form({
		"":function(){}
		,"srvOauth.soId":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvOauth.soToken":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "Token不能为空";
			}
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "Token最大长度为32个字符";
		}
		,"srvOauth.soUserId":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "帐号ID不能为空";
			}
				if(el.value.length>10)
					return "数字太大了";
					 var pattern = /^-?(0|[1-9][0-9]*)?$/;
					 if(!pattern.test(el.value))
						return "请输入正确格式的数字";			
		}
		,"srvOauth.soApiClient":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvOauth.soTicket":function(el){
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "三方标识最大长度为32个字符";
		}
		,"srvOauth.soParams":function(el){
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "三方参数最大长度为32个字符";
		}
		,"srvOauth.soUpdateTime":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "登录时间不能为空";
			}
		}
	},function(){
		/******************************LAZY3Q_FORM_VALIDATE******************************/
		/******************************LAZY3Q_FORM_VALIDATE******************************/
	});		
});
</script>

<body style="display:none;">



<!------------------------VIEW_HTML_TOP------------------------>
<!------------------------VIEW_HTML_TOP------------------------>


<form enctype="{{inports!=null?'multipart/form-data':''}}" lz:if="{{edittype=='insert'||edittype=='update'||edittype=='detail'||edittype=='any'||edittype=='inport'}}" class="form editform edittype_{{edittype}}" ref="SrvOauth" id="oauthForm" name="oauthForm" target="jsoniframe" action="oauth.{{edittype=='any'?'update':edittype}}.do" method="post">
	<div class="head"></div>
	<div class="body">
		<div class="content">
			<div lz:if="{{edittype!='detail'}}" class="prompt">
				温馨提示：请仔细填写用户授权相关信息，<span class="extrude">"*" 为必填选项。</span>
			</div>
			<br/>
			<lz:block lz:if="{{message}}">
			<br/>
			<center>
				<font color="red"><h4>{{message}}</h4></font>
			</center>
			<br/>
			</lz:block>
			<input type="hidden" value="{{complete}}" name="complete" id="complete" />
			<input type="hidden" value="{{ids}}" name="ids" id="ids" />
			<textarea name="PARAMS" id="PARAMS" style="display:none">{{PARAMS}}</textarea>
			
			
			<lz:block lz:if="{{inports}}">
			  <div class="line"></div>
			  <dl style="width:98%;">
			  	<dt>Excel文件:</dt>
			  	<dd>
			  		<input type="hidden" value="{{inports}}" name="inports" id="inports" />
			  		<input type="hidden" value="{{inport$}}" name="inport$" id="inport$" />
			  		<input name="file" name="file" type="file"/>
			  		<b>*</b>
			  		<div>
						请上传excel文件，表格列依次为：[{{inport$}}]，excel表格第一行为列名称，将不作为上传数据行
					</div>
			  	</dd>
			  </dl>
			  <div class="line"></div>
			</lz:block>
	{{lz.set("soId_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"soId"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"soId"))))}}
	{{lz.set("soId_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$soId}}
	<dl lz:if="{{soId_editable||soId_readonly}}" class="soId hidden " major  ref="soId">
		<dt>编　　号:</dt>
		<dd lz:if="{{soId_editable}}" input="hidden">
			<lz:block lz:if="{{srvOauth$soId}}">
				{{srvOauth$soId}}
			</lz:block>
			<lz:block lz:if="{{!srvOauth$soId}}">
			<input type="hidden" value="{{lz.htm(srvOauth.soId)}}" name="srvOauth.soId" id="soId" />
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{soId_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="soId">{{srvOauth.soId}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvOauth.soId$||srvOauth.soId)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$soId}}
	{{lz.set("soToken_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"soToken"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"soToken"))))}}
	{{lz.set("soToken_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$soToken}}
	<dl lz:if="{{soToken_editable||soToken_readonly}}" class="soToken  " major  ref="soToken">
		<dt>Token:</dt>
		<dd lz:if="{{soToken_editable}}" input="text">
			<lz:block lz:if="{{srvOauth$soToken}}">
				{{srvOauth$soToken}}
			</lz:block>
			<lz:block lz:if="{{!srvOauth$soToken}}">
		 	<input type="text" class="input narrow"   name="srvOauth.soToken" id="soToken"  value="{{lz.htm(srvOauth.soToken)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入用户授权的Token</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{soToken_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="soToken">{{srvOauth.soToken}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvOauth.soToken$||srvOauth.soToken)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$soToken}}
	{{lz.set("soUserId_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"soUserId"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"soUserId"))))}}
	{{lz.set("soUserId_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$soUserId}}
	<dl lz:if="{{soUserId_editable||soUserId_readonly}}" class="soUserId  " major  ref="soUserId">
		<dt>帐号ID:</dt>
		<dd lz:if="{{soUserId_editable}}" input="number">
			<lz:block lz:if="{{srvOauth$soUserId}}">
				{{srvOauth$soUserId}}
			</lz:block>
			<lz:block lz:if="{{!srvOauth$soUserId}}">
			<input onkeyup="var reg=/^-?(([1-9]\d{0,9})|0)?/;this.value=this.value.match(reg)?this.value.match(reg)[0]:''" type="text" class="input narrow"  maxlength="8" name="srvOauth.soUserId" id="soUserId"  value="{{lz.htm(srvOauth.soUserId)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入用户授权的帐号ID</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{soUserId_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="soUserId">{{srvOauth.soUserId}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvOauth.soUserId$||srvOauth.soUserId)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$soUserId}}
	{{lz.set("soApiClient_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"soApiClient"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"soApiClient"))))}}
	{{lz.set("soApiClient_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$soApiClient}}
	<dl lz:if="{{soApiClient_editable||soApiClient_readonly}}" class="soApiClient  " major  ref="soApiClient">
		<dt>API客户端:</dt>
		<dd lz:if="{{soApiClient_editable}}" input="query">
			<lz:block lz:if="{{srvOauth$soApiClient}}">
				{{srvOauth$soApiClient}}
			</lz:block>
			<lz:block lz:if="{{!srvOauth$soApiClient}}">
		 			<input title="请输入API客户端客户端ID进行查询" class="combox narrow" action="/admin/api/apiclient.query.do?value={param}" type="text" id="soApiClient" name="srvOauth.soApiClient" text="{{lz.html(srvOauth.soApiClient$||srvOauth.soApiClient)}}" value="{{lz.htm(srvOauth.soApiClient)}}" />
		 			<a class="lookup" href="javascript:void(0);" onclick="if($.trim($('#soApiClient').val())==''){return;};window.href('/admin/api/apiclient.detail.html?key='+$('#soApiClient').val())"></a>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{soApiClient_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="soApiClient">{{srvOauth.soApiClient}}</textarea>
		 		<span>
		 	
			 <a href="javascript:void(0);" onclick="window.href('/admin/api/apiclient.details.html?key=srvOauth.soApiClient}')">
			 {{lz.html(srvOauth.soApiClient$||srvOauth.soApiClient)}}</a>
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$soApiClient}}
	{{lz.set("soTicket_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"soTicket"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"soTicket"))))}}
	{{lz.set("soTicket_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$soTicket}}
	<dl lz:if="{{soTicket_editable||soTicket_readonly}}" class="ribs soTicket  " major  ref="soTicket">
		<dt>三方标识:</dt>
		<dd lz:if="{{soTicket_editable}}" input="text">
			<lz:block lz:if="{{srvOauth$soTicket}}">
				{{srvOauth$soTicket}}
			</lz:block>
			<lz:block lz:if="{{!srvOauth$soTicket}}">
		 	<input type="text" class="input narrow"  maxlength="32" name="srvOauth.soTicket" id="soTicket"  value="{{lz.htm(srvOauth.soTicket)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入用户授权的三方标识</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{soTicket_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="soTicket">{{srvOauth.soTicket}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvOauth.soTicket$||srvOauth.soTicket)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$soTicket}}
	{{lz.set("soParams_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"soParams"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"soParams"))))}}
	{{lz.set("soParams_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$soParams}}
	<dl lz:if="{{soParams_editable||soParams_readonly}}" class="ribs soParams  " major  ref="soParams">
		<dt>三方参数:</dt>
		<dd lz:if="{{soParams_editable}}" input="text">
			<lz:block lz:if="{{srvOauth$soParams}}">
				{{srvOauth$soParams}}
			</lz:block>
			<lz:block lz:if="{{!srvOauth$soParams}}">
		 	<input type="text" class="input narrow"  maxlength="32" name="srvOauth.soParams" id="soParams"  value="{{lz.htm(srvOauth.soParams)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入用户授权的三方参数</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{soParams_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="soParams">{{srvOauth.soParams}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvOauth.soParams$||srvOauth.soParams)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$soParams}}
	{{lz.set("soUpdateTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"soUpdateTime"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"soUpdateTime"))))}}
	{{lz.set("soUpdateTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$soUpdateTime}}
	<dl lz:if="{{soUpdateTime_editable||soUpdateTime_readonly}}" class="soUpdateTime  " major  ref="soUpdateTime">
		<dt>登录时间:</dt>
		<dd lz:if="{{soUpdateTime_editable}}" input="datetime">
			<lz:block lz:if="{{srvOauth$soUpdateTime}}">
				{{srvOauth$soUpdateTime}}
			</lz:block>
			<lz:block lz:if="{{!srvOauth$soUpdateTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="srvOauth.soUpdateTime" id="soUpdateTime"  value="{{srvOauth.soUpdateTime$}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择用户授权的登录时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{soUpdateTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="soUpdateTime">{{srvOauth.soUpdateTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvOauth.soUpdateTime$||srvOauth.soUpdateTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$soUpdateTime}}
			
			
			<div class="line">
				<center lz:if="{{edittype=='insert'}}">
					<a onclick="$('.ribs').show();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:inline;padding: 0px 15px;">点击展开更多编辑项</a>
					<a onclick="$('.ribs').hide();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:none;padding: 0px 15px;">点击收起更多编辑项</a>
				</center>
			</div>
			<center class="buttons">
				<input type="hidden" value="{{srvOauth.soId}}" name="srvOauth.soId" id="soId" />
			
			<lz:block lz:if="{{edittype=='insert'||edittype=='update'||edittype=='any'||edittype=='inport'}}">
				<button class="button" type="submit">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					保存&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
			
			<lz:block lz:if="{{edittype=='detail'}}">
				<button lz:if="{{canEdit}}" type="button" class="button" onclick='window.location.href="/admin/api/oauth.edit.html?edittype=update&id={{srvOauth.id}}"'>
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					修改&nbsp;&nbsp;</button>
				<button lz:if="{{canDel}}" type="button" class="button" onclick="deleteOauth('{{srvOauth.id}}','{{srvOauth.soToken}}')">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					删除&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
					
			</center>
			<br/>

		</div>
	</div>
	<div class="foot"></div>		
</form>

 


<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>


</body>

<!------------------------VIEW_HTML_FOOTER------------------------>
<!------------------------VIEW_HTML_FOOTER------------------------>
<script>
	
	$(function(){
		if(parent.setit){
			parent.setit("/admin/api/oauth.edit.html",document.title,"/admin//images/icons/Keychain2.png");
		}
	});
	
	function cancel(){
		if(parent.closeHref){
			parent.closeHref("/admin/api/oauth.edit.html");
		}else{
			$.closeModalDialog();
		}
	}


	/**
	* 删除用户授权
	**/
	function deleteOauth(id,flag)
	{
		var dialog=top.$.dialog({
				html:"<span style='white-space:nowrap;'>确定要删除当前数据吗？</span>",
				title:"删除用户授权",
				modal: true,			
				onOk:function(){
					dialog.closeDialog();
					var url = "/admin/api/oauth.delete.do";
					var params = {id:id};
					var protocol = $.getAjax(url,params);
					if(protocol.message){
						top.$.toast(protocol.message);
					}
					if(protocol.success){
						caller.location.href=caller.location.href;		
					}
				}
		 });	
	}
</script>
</html>